import VueRouter from 'vue-router'

import MainPage from '../pages/MainPage'
import LoginPage from '../pages/LoginPage'
import IndexPage from '../pages/IndexPage'
import UserPage from '../pages/UserPage'

export default new VueRouter({
  routes :[
    {
      path:'/',
      redirect: '/login'
    },
    {
      name:'login',
      path:'/login',
      component:LoginPage
    },
    {
      name:'home',
      path:'/home',
      component:MainPage,
      children:[
        {
          name: 'index',
          path: '/index',
          component: IndexPage,
        },
        {
          name: 'user',
          path: '/user',
          component: UserPage,
        }
      ]
    }
  ]
})